const express = require("express");

const router = express.Router();
const {
  getUserInfo,
  updateUserInfo,
  updatePassword,
} = require("../router_handler/userinfo");
// 导入验证数据合法性的中间件
const expressJoi = require("@escook/express-joi");
// 导入需要的验证规则对象
const {
  update_userinfo_schema,
  update_password_schema,
} = require("../schema/user");

router.get("/userinfo", getUserInfo);
//更新
router.post("/userinfo", expressJoi(update_userinfo_schema), updateUserInfo);
// 重置密码
router.post("/updatepwd", expressJoi(update_password_schema), updatePassword);

module.exports = router;
